package net.huashitong.brand.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.brand.dao.BrandsDao;
import net.huashitong.brand.entity.Brands;
import net.huashitong.brand.filter.BrandsFilter;
import net.huashitong.goodsclass.entity.GoodsClasses;
import net.huashitong.goodsclass.filter.GoodsClassFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrandsService extends StringPKService<Brands> {
    @Autowired
    private BrandsDao dao;

    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<Brands, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(Brands obj) {
        obj.setSysId(tableService.updateMaxSysId("t_goods_brand", null));
    }


    public List<Brands> queryPageList(BrandsFilter filter)
    {
        List<Brands> query = dao.query(filter);
        return query;
    }


}
